package org.qee.mq.custom;

import java.lang.reflect.ParameterizedType;

/**
 * @ProjectName: learning
 * @Package: org.qee.mq.custom
 * @ClassName: BaseConsumer
 * @Description:
 * @Date: 2021/12/20 8:16 下午
 * @Version: 1.0
 */
public abstract class BaseConsumer<T> implements Consumer<T> {

    protected Class<T> paramType;

    public BaseConsumer() {
        ParameterizedType parameterizedType = (ParameterizedType) getClass().getGenericSuperclass();
        paramType = (Class<T>) parameterizedType.getActualTypeArguments()[0];

    }
}
